<template>
  <div class="">1212</div>
  <van-Button plain type="primary">朴素按钮</van-Button>
</template>

<script setup>
import {} from "vue";
class Boo {
  constructor(a) {
    this.a = a;
  }

  say() {
    console.log(`I say ${this.a}`);
    console.log(this)
  }
}

const boo = new Boo("hello");
console.log(boo,"---")
boo.say()
class Promise{
    static PENDING = 'pending';
    static FULFILLED = 'fulfilled';
    static REJECTED = 'rejected';
    constructor(executor){
        this.status=Promise.FULFILLED
        this.value=null
        console.log(typeof executor)
        try {
            
            executor(this.reslove.bind(this),this.reject.bind(this))
        } catch (error) {
            this.reject(error)
        }
    }
    reslove(value){
        if(this.status==Promise.PENDING){
            this.status=Promise.FULFILLED
            this.value=value
        }
    }
   reject(value){
        if(this.status==Promise.PENDING){
            this.status=Promise.REJECTED
            this.value=value
        }
        console.log(value)
        return 3
    }

}
// let p= new Promise((a,b)=>{console.log(a,b)})
console.log([Promise])
</script>

<style lang="scss" scoped></style>
